<?xml version="1.0" encoding="ISO-8859-1"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<html>
			<head>
				<style type="text/css">
					body { font-family: Verdana; } 
				</style>
			</head>
			<body>
				<center><span style="font-weight: bold;">Test and Code Coverage Results Summary</span></center><br/>
				<br/>
				<span style="font-weight: bold;">Overall - Code Coverage</span>
				<ul>
					<li> 
						<xsl:choose>
							<xsl:when test="substring-before(report/data/all/coverage[1]/@value, '%') = 100">
								<span style="color: green;">Class - <xsl:value-of select="report/data/all/coverage[1]/@value"/></span>
							</xsl:when>
							<xsl:when test="substring-before(report/data/all/coverage[1]/@value, '%') &lt; 100">
								<span style="color: red;">Class - <xsl:value-of select="report/data/all/coverage[1]/@value"/></span>
							</xsl:when>
						</xsl:choose>
					</li>
					<li> 
						<xsl:choose>
							<xsl:when test="substring-before(report/data/all/coverage[2]/@value, '%') = 100">
								<span style="color: green;">Method - <xsl:value-of select="report/data/all/coverage[2]/@value"/></span>
							</xsl:when>
							<xsl:when test="substring-before(report/data/all/coverage[2]/@value, '%') &lt; 100">
								<span style="color: red;">Method - <xsl:value-of select="report/data/all/coverage[2]/@value"/></span>
							</xsl:when>
						</xsl:choose>
					</li>
					<li> 
						<xsl:choose>
							<xsl:when test="substring-before(report/data/all/coverage[3]/@value, '%') &gt;= 85">
								<span style="color: green;">Block - <xsl:value-of select="report/data/all/coverage[3]/@value"/></span>
							</xsl:when>
							<xsl:when test="substring-before(report/data/all/coverage[3]/@value, '%') &lt; 85">
								<span style="color: red;">Block - <xsl:value-of select="report/data/all/coverage[3]/@value"/></span>
							</xsl:when>
						</xsl:choose>
					</li>
					<li> 
						<xsl:choose>
							<xsl:when test="substring-before(report/data/all/coverage[4]/@value, '%') &gt;= 85">
								<span style="color: green;">Line - <xsl:value-of select="report/data/all/coverage[4]/@value"/></span>
							</xsl:when>
							<xsl:when test="substring-before(report/data/all/coverage[4]/@value, '%') &lt; 85">
								<span style="color: red;">Line - <xsl:value-of select="report/data/all/coverage[4]/@value"/></span>
							</xsl:when>
						</xsl:choose>
					</li>
				</ul>
				
				<span style="font-weight: bold;">Overall - Junit Test Results</span>
				<ul>
					<li>Tests - <xsl:value-of select="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@tests"/></li>
					<li> 
						<xsl:choose>
							<xsl:when test="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@failures &lt; 1">
								<span style="color: green;">Failures - <xsl:value-of select="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@failures"/></span>
							</xsl:when>
							<xsl:when test="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@failures &gt; 0">
								<span style="color: red;">Failures - <xsl:value-of select="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@failures"/></span>
							</xsl:when>
						</xsl:choose>
					</li>
					<li>
						<xsl:choose>
							<xsl:when test="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@errors &lt; 1">
								<span style="color: green;">Errors - <xsl:value-of select="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@errors"/></span>
							</xsl:when>
							<xsl:when test="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@errors &gt; 0">
								<span style="color: red;">Errors - <xsl:value-of select="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@errors"/></span>
							</xsl:when>
						</xsl:choose>
					</li>
					<li>Time - <xsl:value-of select="document('TEST-src.test.reseller.TestResellerWebservice.xml')/testsuite/@time"/></li>
				</ul>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>